<!DOCTYPE>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="__PUBLIC__/Home/css/user_center.css">
    <script src="__PUBLIC__/Admin/js/jquery-1.9.1.js"></script>
    <script src="__PUBLIC__/Common/Layer/layer.js"></script>
    <title>供应商中心</title>
</head>

<body>

<style>
    .layui-layer{
        top:150px !important;
    }
</style>
<!-- 栏目 -->
<include file="Public:header_shoper" />

<!-- 内容 -->
<div style="background-color:#f5f5f5;">
    <div class="content" style="width:1200px;">


        <div style="margin-top:20px;">
            <div class="Options" style=" width:1160px; background-color:#FFF; padding:20px;">
                <ul id="tabs">
                   <li><a href="{:U('User/my_order_lst')}" title="tab1">全部订单</a></li>
                   <div class="search1"><input type="text" value=""><img src="__PUBLIC__/Home/img/search2.jpg" width="23" height="23"></div>

                </ul>
                <div id="content">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="size12">
                        <tr>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">近三个月订单</td>
                            <td width="50%" height="34" align="center" bgcolor="#f5f5f5">订单详情 </td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">收货人</td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">金额</td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">当前状态</td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">操作</td>
                        </tr>
                    </table>

                 
                    <foreach name="result" item="vo">
                    <div id="tab3" class="tab{$vo.id}">
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#e4e4e4" style="margin:20px 0; line-height:24px;" class="size12">
                            <tr>
                                <td colspan="5" bgcolor="#f5f5f5" class="text-indent">
                                <span class="gray"> 订单号：</span>{$vo.orders_num}
                                </td>
                            </tr>
                            <tr>
                                <td width="60%" height="13" bgcolor="#FFFFFF">
                                    <foreach name="vo.goods_record" item="res_vo">
                                        <span class="Odd-number">
                                            <a target="_blank" href="{:U('Index/goods_details')}?id={$res_vo.goods_id}">
											<img src="__PUBLIC__/Uploads/goods/{$res_vo.pic_url}" width="60" height="60">
                                            </a>
                                            <a target="_blank" href="{:U('Index/goods_details')}?id={$res_vo.goods_id}">
                                            <b class="name1" style="width:420px;">{$res_vo.goods_title}<br/>套餐: [ <span style="color:#E03E3C;">{$res_vo.taocan_name}</span> ]</b>
											</a>
                                            <b class="Quantity" style="width:100px;"> x {$res_vo.goods_num}</b>
											
                                        </span>
                                    </foreach>
                                </td>
                                <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:50px;">
                                {$vo.realname}<br/>{$vo.mobile}
                                </td>
                                <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:10px;">
                                    <p class="gray">总额 ￥{$vo.price_sum}</p>
                                    <p class="bold">应付</p>
                                    <p class="bold">￥{$vo.price_sum} 元</p>
                                </td>
                                <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:10px;">

                                
                                    <if condition="$vo['pay_status'] eq 0">
                                        <p class="red">待付款</p>

                                    </if>


                                    <if condition="$vo['pay_status'] eq 1 && $vo['orders_status'] eq 0">
                                        <p class="red">待发货</p>
                                    </if>

                                    <if condition="$vo['orders_status'] egt 2">
                                        <p class="track">
                                        <if condition="!empty($vo['fahuo_time'])">
                                        <p class="red">已发货</p>
                                            <a href="javascript:;" style="padding:2px 10px; border:1px solid #CCC;" onclick="show_info({$vo[kuaidi_num]})">物流跟踪</a>
                                           <br/> 快递单号: {$vo[kuaidi_num]}
                                        </if>
                                    </p>
                                    </if>

                                    <if condition="$vo['orders_status'] eq 3">
                                        <p class="red">已签收</p>
                                    </if>

                                    <if condition="$vo['orders_status'] eq 4">
                                        <p class="red">已申请退货</p>
                                    </if>

                                    
                                    


                                    <if condition="$vo['orders_status'] eq 8">
                                        <p class="red">已完成</p>
                                    </if>

                                    




									<script>
										function show_info(num){                                         
											parent.layer.open({
												type: 2,
												shadeClose: true,
												shade: 0.2,
												area: ['800px', '550px'],
												title: '查询快递单号',
												content: 'http://www.zzumall.com/kuaidi/index.php?num='+num,
											});
										}
									</script>


                                    <!--<p><a href="javascript:void (0);">订单详情</a></p>-->
                                </td>


                                <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:10px;">
                                    <if condition="$vo['pay_status'] eq 0">
                                            <p><a href="javascript:;" style="padding:2px 10px; border:1px solid #CCC;" onclick="cancel_order({$vo['id']})">取消订单</a></p>
                                    </if>

                                    <if condition="$vo['orders_status'] eq 2">  
                                            <p>已支付</p>                                         
                                            <p>等待确认收货</p>
                                    </if>

                                    <if condition="$vo.kuaidi_num eq ''">
                                        <if condition="$vo['pay_status'] == 1 && $vo['orders_status'] != 4">
                                            <p>已支付</p>
                                            <a href="javascript:;" style="padding:2px 10px; border:1px solid #CCC;" onclick="add({$vo.id})" style=" border-radius:5px; background:#555;">发货</a>
                                        </if>
                                    <else/>
                                        <if condition="$vo['orders_status'] != 4 and $vo['orders_status'] != 5">
                                            <a href="javascript:;" style="padding:2px 10px; border:1px solid #CCC;" onclick="done({$vo.id})" >确认完成</a>
                                        </if>
                                    </if>

                                    <if condition="$vo['tuihuo_chuli_status'] eq 1">
                                        <p class="red">允许退货并退款</p>
                                    </if>

                                    <if condition="$vo['tuihuo_chuli_status'] eq -1">
                                        <p class="red">拒绝退货申请</p>
                                    </if>

                                    

                                    <if condition="$vo['orders_status'] eq 3">                                           
                                            <p>已确认收货</p>
                                            <p><a href="{:U('User/pingjia')}?orders_id={$vo.id}" class="payment">评价</a></p>
                                    </if>

                                   
                                </td>


                            </tr>
                            <tr>
                                <td height="14" bgcolor="#FFFFFF"><span style="display: inline-block; text-align: center">&nbsp;收货地址：</span>{$vo.user_address}
<br/> &nbsp;下单时间: {$vo.create_time|date='Y-m-d H:i:s',###}
                                </td>
                            </tr>
                        </table>
                    </div>
                    </foreach>
                    <div style="text-align: center">
                       {$page}
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!-- 底部 -->
    <include file="Public:footer_shoper" />
</body>

<script>
    //取消订单
    function cancel_order(id){
        $.post("{:U('User/cancel_order')}", { "id": id},function(data){
            if(data==1){
                layer.msg('删除成功', {

                    time: 2000 //2秒关闭（如果不配置，默认是3秒）
                }, function(){
                    $('.tab'+id).remove();
                });
            }else{
                layer.msg('删除失败');
            }
        }, "json");
    }

    function add(a){
        parent.layer.open({
            type: 2,
            shadeClose: true,
            shade: 0.5,
            area: ['450px', '250px'],
            title: '添加发货信息',
            content: '{:U("Shoper/kuaidi_add")}?id='+a,
        });
    }
</script>
</html>
